package vista.panels;

import javax.swing.JPanel;
import javax.swing.GroupLayout;
import javax.swing.GroupLayout.Alignment;
import javax.swing.JLabel;
import javax.swing.LayoutStyle.ComponentPlacement;
import javax.swing.JTextField;
import javax.swing.JButton;

import cliente.ClienteImp;

public class PanelCrearOrdenDePedido extends JPanel {
	private JTextField txtFecha;
	private JTextField txtCuil;
	private JTextField txtRazonSocial;
	private JTextField txtFinanciacion;
	private JTextField txtNrocotizacion;

	/**
	 * Create the panel.
	 * @param cliente 
	 */
	public PanelCrearOrdenDePedido(ClienteImp cliente) {
		
		JLabel lblFechaddmmyyyy = new JLabel("Fecha (dd/mm/yyyy)");
		
		JLabel lblCuilCliente = new JLabel("Cuil Cliente");
		
		JLabel lblRazonSocialCliente = new JLabel("Razon Social Cliente");
		
		JLabel lblFinanciaciondias = new JLabel("Financiacion (dias)");
		
		JLabel lblNroCotizacion = new JLabel("Nro Cotizacion");
		
		txtFecha = new JTextField();
		txtFecha.setColumns(10);
		
		txtCuil = new JTextField();
		txtCuil.setColumns(10);
		
		txtRazonSocial = new JTextField();
		txtRazonSocial.setColumns(10);
		
		txtFinanciacion = new JTextField();
		txtFinanciacion.setColumns(10);
		
		txtNrocotizacion = new JTextField();
		txtNrocotizacion.setColumns(10);
		
		JButton btnBuscarCliente = new JButton("Buscar Cliente");
		
		JButton btnAgregarCotizacion = new JButton("Agregar Cotizacion");
		GroupLayout groupLayout = new GroupLayout(this);
		groupLayout.setHorizontalGroup(
			groupLayout.createParallelGroup(Alignment.LEADING)
				.addGroup(groupLayout.createSequentialGroup()
					.addContainerGap()
					.addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
						.addGroup(groupLayout.createSequentialGroup()
							.addComponent(lblFechaddmmyyyy)
							.addPreferredGap(ComponentPlacement.RELATED)
							.addComponent(txtFecha, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
						.addGroup(groupLayout.createSequentialGroup()
							.addComponent(lblCuilCliente)
							.addPreferredGap(ComponentPlacement.RELATED)
							.addComponent(txtCuil, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
							.addGap(48)
							.addComponent(btnBuscarCliente))
						.addGroup(groupLayout.createSequentialGroup()
							.addComponent(lblRazonSocialCliente)
							.addPreferredGap(ComponentPlacement.RELATED)
							.addComponent(txtRazonSocial, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
						.addGroup(groupLayout.createSequentialGroup()
							.addComponent(lblFinanciaciondias)
							.addPreferredGap(ComponentPlacement.RELATED)
							.addComponent(txtFinanciacion, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
						.addGroup(groupLayout.createSequentialGroup()
							.addComponent(lblNroCotizacion)
							.addPreferredGap(ComponentPlacement.RELATED)
							.addComponent(txtNrocotizacion, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
							.addPreferredGap(ComponentPlacement.RELATED)
							.addComponent(btnAgregarCotizacion)))
					.addContainerGap(160, Short.MAX_VALUE))
		);
		groupLayout.setVerticalGroup(
			groupLayout.createParallelGroup(Alignment.LEADING)
				.addGroup(groupLayout.createSequentialGroup()
					.addContainerGap()
					.addGroup(groupLayout.createParallelGroup(Alignment.BASELINE)
						.addComponent(lblFechaddmmyyyy)
						.addComponent(txtFecha, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
					.addPreferredGap(ComponentPlacement.UNRELATED)
					.addGroup(groupLayout.createParallelGroup(Alignment.BASELINE)
						.addComponent(lblCuilCliente)
						.addComponent(txtCuil, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
						.addComponent(btnBuscarCliente))
					.addPreferredGap(ComponentPlacement.RELATED)
					.addGroup(groupLayout.createParallelGroup(Alignment.BASELINE)
						.addComponent(lblRazonSocialCliente)
						.addComponent(txtRazonSocial, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
					.addPreferredGap(ComponentPlacement.RELATED)
					.addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
						.addGroup(groupLayout.createSequentialGroup()
							.addComponent(lblFinanciaciondias)
							.addPreferredGap(ComponentPlacement.UNRELATED)
							.addGroup(groupLayout.createParallelGroup(Alignment.BASELINE)
								.addComponent(lblNroCotizacion)
								.addComponent(txtNrocotizacion, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
								.addComponent(btnAgregarCotizacion)))
						.addComponent(txtFinanciacion, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
					.addContainerGap(167, Short.MAX_VALUE))
		);
		setLayout(groupLayout);

	}

}
